Conversation
| ) | ||
|
|
||
| // TestInitExportGenesis tests the import and export flow for the channel v2 keeper. | ||
| func (suite *KeeperTestSuite) TestInitExportGenesis() { |
There was a problem hiding this comment.
This testing setup is what I feel the least confident about. There was not a previous testing setup in the v1 module for genesis, so this is what I rolled with.
The intricacy is that the ibctesting suite already has initialized genesis for things like the client keeper and some actions have led to state existing. So for creating a valid genesis that will be exported properly, we have to use existing state to set it
3360b99 to
6459667
Compare
gjermundgaraba
left a comment
There was a problem hiding this comment.
After checking this more carefully, I believe it needs some changes to work the same way as v1.
If you look at how genesis and the whole module is set up in v1, it is all done through the core IBC module. So InitGenesis and all of that is called from there. This is also where it is tested in v1.
AdityaSripal
left a comment
There was a problem hiding this comment.
Generally looks good!! Think the testing setup can be improved either here or in subsequent PR
| var commitments []types.PacketState | ||
| for ; iterator.Valid(); iterator.Next() { | ||
| sequenceBz := bytes.TrimPrefix(iterator.Key(), storePrefix) | ||
| sequence := sdk.BigEndianToUint64(sequenceBz) |
There was a problem hiding this comment.
What happens if this byte slice is more than 64 bytes? Should never happen but perhaps we should add a defensive check
Addressed here |
AdityaSripal
left a comment
There was a problem hiding this comment.
Looks great! Thanks
|
gjermundgaraba
left a comment
There was a problem hiding this comment.
Nice! Thank you 🙏🦸🚀



Description
Wire up the genesis for the
channel/v2moduleCreate keeper functions for getting all of the state per Client ID
Keeper-level testing
closes: #7922
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/).godoccomments.Files changedin the GitHub PR explorer.SonarCloud Reportin the comment section below once CI passes.